<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		
		<meta name="Description" content="" />
        <meta name="Keywords" content="" />
        
		<title>XSLT Templater - test</title>
		
		<link href="style.css" rel="stylesheet" type="text/css" />
		
		<script type="text/javascript" src="/jQuery-1.4.2.js"></script>
		<script type="text/javascript" src="/jquery.xslt.yui.js"></script>
		<script type="text/javascript">
			$(document).ready(function() {
				var xmlString = "<xml-message>"+
			    					"<message>It working with string representation of xml</message>"+
			    				"</xml-message>";
			    var xslString = '<?xml version="1.0"?>'+
			    				'<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">'+
			    						'<xsl:template match="xml-message">'+
			    							'<p>Result: <xsl:value-of select="message/text()"/>!</p>'+
			    						'</xsl:template>'+
			    				'</xsl:stylesheet>';
			
				var time = new Date();
				
    			$('#test1').xslt(xmlString,xslString,function() {
    					$('#test5').xslt(xmlString,xslString);
    			});

    			$('#test2').xslt("/tests/data/message.xml",
			    				xslString, 
			    				function() {
				    				$('#test3').xslt("/tests/data/message.xml",
					    							 "/tests/xslt/message-template.xsl",  
					    							 function() {
					    								$('#test4').xslt("/tests/data/message.xml",
					    												 "/tests/xslt/message-template.xsl",
					    												 function(){
					    												 	var time2 = new Date();
					    												 	$("#time").text("Calculating time:"+(time2-time));
					    												 });
					    							 }
					    			);	
    							}
    			);
    			
			});
				
		</script>
		
	</head>

	<body>
	
		<img src="/XSLTTemplater.png" alt="XSLT Templater"/>
		
		<div id="test1" class="xsltConteiner">
			
		</div>
		
		<div id="test2" class="xsltConteiner">
			
		</div>
		
		<div id="test3" class="xsltConteiner">
			
		</div>
		
		<div id="test4" class="xsltConteiner">
			
		</div>
		
		<div id="test5" class="xsltConteiner">
			
		</div>
		
		<span id="time"></span>
		
	</body>
</html>